<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
<%@ taglib uri="http://www.myfirefly.cn/tag/auth" prefix="auth"%>
<script type="text/javascript">
	var returnVisitCountDataGrid = $('#returnVisitCount-datagrid-json').datagrid({
		gridTitle : '回访汇总统计',
	    showToolbar: true,
	    addLocation: 'first',
	    filterThead: false,
	    filterAll: true,
	    showLinenumber: false,
	    sortAll : true,
	    <auth:has funcId="returnVisitCount" action="/returnVisitCount/list.do">
	    dataUrl: 'returnVisitCount/list.do',
	    </auth:has>
	    dataType: 'json',
	    columns: [
	    	{
	            name: 'returnVisitDate',
	            label: '回访日期',
	            type : 'date',
	            align: 'center',
	            width: 120,
	            render: function(val) {
	            	if(val){
	            		val = dateToStr('yyyy-MM-dd', new Date(val));
	            	}
	            	return val;
	            }
	        },
	        {
	            name: 'tradeRegion',
	            label: '成交区域',
	            align: 'center',
	            width: 120
	        },
	        {
	            name: 'tradeShop',
	            label: '成交店面',
	            align: 'center',
	            width: 120
	        },
	        {
	            name: 'tradePerson',
	            label: '成交人',
	            align: 'center',
	            width: 120
	        },
	        {
	            name: 'tradeDate',
	            label: '成交日期',
	            type : 'date',
	            align: 'center',
	            width: 120,
	            render: function(val) {
	            	if(val){
	            		val = dateToStr('yyyy-MM-dd', new Date(val));
	            	}
	            	return val;
	            }
	        },
	        {
	            name: 'tradeAddress',
	            label: '成交地址',
	            align: 'center',
	            width: 380
	        },
	        {
	            name: 'returnVisitPerson',
	            label: '回访人',
	            align: 'center',
	            width: 120
	        },
	        {
	            name: 'returnVisitContent',
	            label: '回访内容',
	            align: 'center',
	            width: 400
	        }
	    ],
	    afterSave: function($trs, datas) {
	        	this.refresh();
	        },
	    paging: {pageSize:20, selectPageSize:'20,30,40'},
	    showTfoot: true,
	    fullGrid: false,
	    <auth:has funcId="returnVisitCount" action="/returnVisitCount/export.do">
	    toolbarItem: 'export',
	    exportOption: {
	    	type:"file", 
	    	options: {
	    		url:'returnVisitCount/export.do'
	    	}
	    },
	    </auth:has>
	    toolbarCustom: function(){
	    	var html = '';
	    	html += '<div class="btn-group" role="group"><button type="button" class="btn btn-green" onclick="refreshReturnVisitCount()"><i class="fa fa-refresh"></i> 刷新</button></div>';
		    return html;
	    }
	});
	
	function refreshReturnVisitCount() {
		returnVisitCountDataGrid.datagrid("refresh");
	}

</script>
<div class="bjui-pageContent" id="returnVisitCount-index-pagecontent">
    <div style="padding:0px; height:100%; width:100%;">
        <table id="returnVisitCount-datagrid-json" data-width="100%" data-height="100%" class="table table-bordered">
        </table>
    </div>
</div>
<div id="edit-returnVisitCount-dialog" style="display: none;">
</div>
</div>